{
	"title": "SearXNG config",
	"description": "Unofficial schema draft for SearXNG config",
	"type": "object",
	"properties": {
		"autocomplete": {
			"description": "The search engine used for autocomplete results",
			"type": "string",
			"minLength": 0,
			"maxLength": 255
		},
		"brand": {
			"description": "Metadata for this instance",
			"type": "object",
			"properties": {
				"CONTACT_URL": {
					"oneOf": [
						{
							"type": "boolean"
						},
						{
							"type": "string",
							"format": "uri"
						},
						{
							"type": "null"
						}
					]
				},
				"DOCS_URL": {
					"oneOf": [
						{
							"type": "boolean"
						},
						{
							"type": "string",
							"format": "uri"
						},
						{
							"type": "null"
						}
					]
				},
				"GIT_BRANCH": {"type": "string"},
				"GIT_URL": {"type": "string", "format": "uri"},
				"PRIVACYPOLICY_URL": {
					"oneOf": [
						{
							"type": "boolean"
						},
						{
							"type": "string",
							"format": "uri"
						},
						{
							"type": "null"
						}
					]
				}
			},
			"additionalProperties": false
		},
		"categories": {
			"description": "List with search categories",
			"type": "array",
			"items": {
				"type": "string",
				"minLength": 1,
				"maxLength": 255
			},
			"minItems": 0,
			"maxItems": 128
		},
		"default_doi_resolver": {
			"type": "string",
			"format": "uri"
		},
		"default_locale": {
			"type": "string",
			"minLength": 0,
			"maxLength": 32
		},
		"default_theme": {
			"type": "string",
			"minLength": 0,
			"maxLength": 32
		},
		"doi_resolvers": {
			"description": "Available doi resolvers",
			"type": "array",
			"items": {
				"type": "string",
				"format": "uri"
			},
			"minItems": 0,
			"maxItems": 128
		},
		"engines": {
			"description": "List with search engine objects",
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"categories": {
						"description": "List with search categories that this engine is part of",
						"type": "array",
						"items": {
							"type": "string",
							"minLength": 1,
							"maxLength": 255
						},
						"minItems": 0,
						"maxItems": 128
					},
					"enabled": {
						"description": "Whether this engine is enabled or not",
						"type": "boolean"
					},
					"language_support": {
						"description": "Whether this engine supports searching in a given language",
						"type": "boolean"
					},
					"languages": {
						"description": "Languages this search engines supports (SearXNG)",
						"type": "array",
						"items": {
							"type": "string",
							"minLength": 1,
							"maxLength": 32
						},
						"minItems": 0,
						"maxItems": 1024
					},
					"supported_languages": {
						"description": "Languages this search engines supports (SearX)",
						"type": "array",
						"items": {
							"type": "string",
							"minLength": 1,
							"maxLength": 32
						},
						"minItems": 0,
						"maxItems": 8192
					},
					"name": {
						"description": "Search engine name",
						"type": "string",
						"minLength": 1,
						"maxLength": 128
					},
					"paging": {
						"description": "Whether this engine supports paging",
						"type": "boolean"
					},
					"regions": {
						"description": "Regions this search engines supports (TODO this the same as languages?)",
						"type": "array",
						"items": {
							"description": "Example: da-DK",
							"type": "string",
							"minLength": 1,
							"maxLength": 32
						},
						"minItems": 0,
						"maxItems": 1024
					},
					"safesearch": {
						"description": "Whether safe search is supported by this engine",
						"type": "boolean"
					},
					"shortcut": {
						"description": "Shortcut for this engine",
						"type": "string",
						"minLength": 0,
						"maxLength": 16
					},
					"time_range_support": {
						"description": "Whether this engine supports searching based on time range",
						"type": "boolean"
					},
					"timeout": {
						"type": "number",
						"minimum": 1,
						"maximum": 120
					}
				},
				"additionalProperties": false
			},
			"minItems": 0,
			"maxItems": 1024
		},
		"instance_name": {
			"description": "Fancy name of this instance",
			"type": "string",
			"minLength": 1,
			"maxLength": 255
		},
		"limiter": {
			"type": "object",
			"properties": {
				"botdetection.ip_limit.link_token": {
					"type": "boolean"
				},
				"botdetection.ip_lists.pass_searxng_org": {
					"type": "boolean"
				},
				"enabled": {
					"type": "boolean"
				}
			}
		},
		"locales": {
			"description": "List of locales this SearXNG instance supports",
			"type": "object",
			"propertyNames": {
				"description": "Locale code",
				"type": "string",
				"minLength": 2,
				"maxLength": 16
			},
			"additionalProperties": {
				"description": "Locale full name",
				"type": "string",
				"minLength": 3,
				"maxLength": 128
			}
		},
		"plugins": {
			"description": "List of available plugins and their status",
			"type": "array",
			"items": {
				"type": "object",
				"properties": {
					"enabled": {
						"description": "Whether this plugin is enabled or not",
						"type": "boolean"
					},
					"name": {
						"description": "Name of this plugin",
						"type": "string"
					}
				},
				"additionalProperties": false
			}
		},
		"public_instance": {
			"description": "Whether this is a public (true) or private (false) instance",
			"type": "boolean"
		},
		"safe_search": {
			"description": "Whether safe search is enabled or not",
			"type": "number",
			"enum": [0, 1, 2]
		},
		"version": {
			"anyOf": [
				{
					"type": "string",
					"description": "Version pattern SearXNG",
					"pattern": "^([0-9]{1,4}\\.){2}([0-9]{1,4})(\\+[a-fA-F0-9]{1,9})?$"
				},
				{
					"type": "string",
					"description": "Version pattern SearX",
					"pattern": "^([0-9]{1,4}\\.){2}([0-9]{1,4})((\\-[0-9]{1,4}\\-[a-fA-F0-9]{1,10})|(-unknown))?$"
				}
			]
		}
	},
	"additionalProperties": false
}
